Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const support #57

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

const support #57

wants to merge 3 commits into from

Conversation

snowsignal
Copy link
Contributor

Closes #44.

This PR will allow the typeshare annotation to be used for const variables. This will copy the variable declaration into the output for the respective language.

For example:

const ANSWER_TO_EVERYTHING: u32 = 42;
const BEST_FILM: &str = "The Tree of Life";

This would become:

const ANSWER_TO_EVERYTHING = 42;
const BEST_FILM = "The Tree of Life";
class Constants {
  static let ANSWER_TO_EVERYTHING = 42
  static let BEST_FILM = "The Tree of Life"
}
const val ANSWER_TO_EVERYTHING = 42
const val BEST_FILM = "The Tree of Life"
const ANSWER_TO_EVERYTHING = 42
const BEST_FILM = "The Tree of LIfe"

As of right now, this PR only supports integers, floats, and strings as constant types.

@snowsignal snowsignal marked this pull request as draft January 27, 2023 02:57
@beyera
Copy link

beyera commented Aug 18, 2023

I would like to have this 👍

@lpi
Copy link

lpi commented Aug 25, 2023

Is this still being worked on? It seems very useful

@snowsignal
Copy link
Contributor Author

Is this still being worked on? It seems very useful

Sorry, this has been put on hold for a while. I'm no longer actively involved with this specific project but I'll try to get this merged when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for constants
3 participants